package com.example.emos.wx.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;

/**
 * @ClasName MessageRefEntity
 * @Descripution 消息接收数据 MongoDBDocument类
 * @Author leikw
 * @Date 2023/2/7 14:39
 * @Version V1.0
 */
@Data
@Document(collection = "message_ref")
public class MessageRefEntity implements Serializable {

    /**
     * MongoDB 主键
     */
    @Id
    private String _id;

    /**
     * message记录的_id
     */
    @Indexed
    private String messageId;

    /**
     * 接收人ID
     */
    @Indexed
    private Integer receiverId;

    /**
     * 是否已读
     */
    @Indexed
    private Boolean readFlag;

    /**
     * 是否为新接收的消息
     */
    @Indexed
    private Boolean lastFlag;
}
